:root {
    --primary: #1d4ed8;
    --primary-light: #93c5fd;
    --bg: #f0f7ff;
    --text: #1e293b;
    --text-light: #64748b;
    --input-bg: #ffffff;
    --border-radius: 12px;
    --box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
    --card-bg: #ffffff;
    --gradient-start: #1d4ed8;
    --gradient-end: #0ea5e9;
}

.theme-purple {
    --primary: #7c3aed;
    --primary-light: #c4b5fd;
    --bg: #f8f5ff;
    --card-bg: #ffffff;
    --gradient-start: #7c3aed;
    --gradient-end: #c084fc;
}

.theme-blue {
    --primary: #1d4ed8;
    --primary-light: #bfdbfe;
    --bg: #f0f7ff;
    --card-bg: #ffffff;
    --gradient-start: #1d4ed8;
    --gradient-end: #0ea5e9;
}

.theme-orange {
    --primary: #ea580c;
    --primary-light: #fed7aa;
    --bg: #fff7ed;
    --card-bg: #ffffff;
    --gradient-start: #ea580c;
    --gradient-end: #f97316;
}

.theme-dark {
    --primary: #818cf8;
    --primary-light: #a5b4fc;
    --bg: #0f172a;
    --text: #e2e8f0;
    --text-light: #94a3b8;
    --input-bg: #1e293b;
    --card-bg: #1e293b;
    --gradient-start: #818cf8;
    --gradient-end: #60a5fa;
}

.theme-mint {
    --primary: #0d9488;
    --primary-light: #99f6e4;
    --bg: #f0fdfa;
    --card-bg: #ffffff;
    --gradient-start: #0d9488;
    --gradient-end: #14b8a6;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

body {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--bg) 0%, #e4edf9 100%);
    color: var(--text);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow: auto;
    position: relative;
}

.background-pattern {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(var(--primary-light) 1px, transparent 1px);
    background-size: 30px 30px;
    opacity: 0.15;
    z-index: -2;
}

.theme-switcher {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(29, 78, 216, 0.1);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--primary);
    font-size: 18px;
    z-index: 100;
    box-shadow: var(--box-shadow);
    transition: all 0.3s ease;
}

    .theme-switcher:hover {
        transform: scale(1.1) rotate(15deg);
        background: rgba(255, 255, 255, 1);
        box-shadow: 0 8px 25px rgba(29, 78, 216, 0.15);
    }

.container {
    max-width: 500px;
    width: 100%;
    text-align: center;
    z-index: 10;
    margin: 20px auto 30px;
    position: relative;
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 35px;
    box-shadow: var(--box-shadow);
    border: 1px solid rgba(29, 78, 216, 0.1);
    transform: translateY(0);
    opacity: 1;
    animation: fadeInUp 0.8s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.header {
    margin-bottom: 30px;
    position: relative;
}

.icon-title {
    font-size: 42px;
    color: var(--primary);
    margin-bottom: 15px;
    position: relative;
    display: inline-block;
}

    .icon-title::after {
        content: "";
        position: absolute;
        bottom: -8px;
        left: 50%;
        transform: translateX(-50%);
        width: 60px;
        height: 3px;
        background: linear-gradient(to right, var(--gradient-start), var(--gradient-end));
        border-radius: 3px;
    }

.main-title-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin-bottom: 15px;
}

.main-title-image {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    padding: 4px;
    transition: all 0.3s ease;
}

    .main-title-image:hover {
        transform: scale(1.05);
        box-shadow: 0 10px 25px rgba(29, 78, 216, 0.2);
    }

.main-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: -0.5px;
    background: linear-gradient(to right, var(--gradient-start), var(--gradient-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    position: relative;
}

.subtitle {
    font-size: 15px;
    color: var(--text-light);
    margin-bottom: 30px;
    line-height: 1.6;
}

.buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

.btn {
    padding: 16px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background: linear-gradient(to right, var(--gradient-start), var(--gradient-end));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: var(--box-shadow);
    position: relative;
    overflow: hidden;
}

    .btn::before {
        content: "";
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
        transition: 0.5s;
    }

    .btn:hover::before {
        left: 100%;
    }

    .btn:hover {
        transform: translateY(-5px);
        box-shadow: 0 10px 25px rgba(29, 78, 216, 0.25);
    }

    .btn i {
        font-size: 18px;
    }

.notice {
    background: linear-gradient(to right, rgba(29, 78, 216, 0.03), rgba(14, 165, 233, 0.03));
    border-radius: var(--border-radius);
    padding: 22px;
    border: 1px solid rgba(29, 78, 216, 0.1);
    margin-bottom: 25px;
    text-align: left;
    position: relative;
    overflow: hidden;
}

    .notice::before {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        width: 5px;
        height: 100%;
        background: linear-gradient(to bottom, var(--gradient-start), var(--gradient-end));
    }

    .notice h3 {
        font-size: 16px;
        margin-bottom: 15px;
        color: var(--primary);
        display: flex;
        align-items: center;
        gap: 10px;
        font-weight: 700;
    }

    .notice p {
        color: var(--text-light);
        line-height: 1.7;
        font-size: 14px;
    }

#firework-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
    overflow: hidden;
}

.firework {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    animation: firework-explode 1.2s ease-out forwards;
}

.firework-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    animation: firework-particle 1.2s ease-out forwards;
}

.character-firework {
    position: absolute;
    font-size: 54px;
    font-weight: bold;
    color: white;
    text-shadow: 0 0 20px currentColor;
    animation: character-reveal 2s ease-out forwards;
    z-index: 100;
    font-family: 'Arial Rounded MT Bold', 'Segoe UI', sans-serif;
}

@keyframes firework-explode {
    0% {
        transform: translate(var(--start-x), var(--start-y)) scale(0);
        opacity: 1;
    }

    10% {
        transform: translate(var(--mid-x), var(--mid-y)) scale(1);
        opacity: 1;
    }

    100% {
        transform: translate(var(--mid-x), var(--mid-y)) scale(0);
        opacity: 0;
    }
}

@keyframes firework-particle {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }

    100% {
        transform: translate(var(--tx), var(--ty)) scale(0);
        opacity: 0;
    }
}

@keyframes character-reveal {
    0% {
        transform: scale(5);
        opacity: 0;
    }

    20% {
        transform: scale(1);
        opacity: 1;
    }

    80% {
        transform: scale(1);
        opacity: 1;
    }

    100% {
        transform: scale(0);
        opacity: 0;
    }
}

.meteor {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 15px 3px currentColor;
    z-index: -1;
    animation: meteor-fall linear forwards;
}

    .meteor::before {
        content: '';
        position: absolute;
        top: 50%;
        left: 0;
        transform: translateY(-50%);
        width: 180px;
        height: 3px;
        background: linear-gradient(90deg, currentColor 0%, transparent 80%);
        border-radius: 2px;
    }

@keyframes meteor-fall {
    0% {
        transform: translate(var(--start-x), var(--start-y)) rotate(var(--angle));
        opacity: 1;
    }

    100% {
        transform: translate(var(--end-x), var(--end-y)) rotate(var(--angle));
        opacity: 0;
    }
}

#final-code {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 32px;
    font-weight: 800;
    color: white;
    text-shadow: 0 0 25px rgba(255, 255, 255, 0.8);
    opacity: 0;
    z-index: 20;
    transition: opacity 0.5s;
    background: linear-gradient(to right, var(--gradient-start), var(--gradient-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    padding: 20px 40px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    background-color: rgba(0, 0, 0, 0.4);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

    #final-code.show {
        opacity: 1;
        animation: pulse 2s infinite;
    }

@keyframes pulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
    }

    50% {
        transform: translate(-50%, -50%) scale(1.05);
    }

    100% {
        transform: translate(-50%, -50%) scale(1);
    }
}

#music-player {
    position: fixed;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    border-radius: 50px;
    padding: 12px 25px;
    display: flex;
    align-items: center;
    gap: 18px;
    z-index: 100;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.4s;
    border: 1px solid rgba(29, 78, 216, 0.15);
    opacity: 0;
    transform: translateX(-50%) translateY(30px);
    animation: slideIn 0.8s 0.5s forwards;
}

@keyframes slideIn {
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

#music-info {
    min-width: 130px;
}

#music-title {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#music-artist {
    font-size: 12px;
    color: var(--text-light);
}

.music-control {
    background: rgba(29, 78, 216, 0.1);
    border: none;
    color: var(--primary);
    font-size: 15px;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

    .music-control:hover {
        background: rgba(29, 78, 216, 0.2);
        transform: scale(1.15);
    }

.loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

html, body {
    height: 100%;
}

.hidden {
    display: none !important;
}

.music-player-hidden {
    display: none !important;
}

.music-list-container {
    position: fixed;
    bottom: 85px;
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    max-height: 320px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    border-radius: 20px;
    padding: 15px;
    z-index: 200;
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
    overflow-y: auto;
    display: none;
    transition: all 0.3s;
    border: 1px solid rgba(29, 78, 216, 0.1);
}

    .music-list-container.show {
        display: block;
        animation: slideUp 0.4s ease-out;
    }

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.music-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(29, 78, 216, 0.1);
}

.music-list-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary);
}

.close-list {
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

    .close-list:hover {
        color: var(--primary);
        transform: rotate(90deg);
    }

.music-item {
    padding: 14px 16px;
    border-radius: 10px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 12px;
    background: transparent;
}

    .music-item:hover, .music-item.playing {
        background: rgba(29, 78, 216, 0.05);
    }

    .music-item.playing {
        border-left: 3px solid var(--primary);
    }

.music-item-icon {
    color: var(--primary);
    font-size: 18px;
}

.music-item-info {
    flex: 1;
}

.music-item-title {
    font-size: 14px;
    font-weight: 600;
}

.music-item-artist {
    font-size: 12px;
    color: var(--text-light);
}

#return-btn {
    position: fixed;
    bottom: 35px;
    background: linear-gradient(to right, var(--gradient-start), var(--gradient-end));
    color: white;
    border: none;
    border-radius: 50px;
    padding: 12px 25px;
    font-size: 15px;
    cursor: pointer;
    z-index: 100;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 10px 25px rgba(29, 78, 216, 0.25);
}

    #return-btn.show {
        opacity: 1;
        transform: translateY(0);
    }

.particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    opacity: 0.2;
}

.footer-note {
    margin-top: 20px;
    font-size: 12px;
    color: var(--text-light);
    text-align: center;
    max-width: 500px;
    padding: 0 20px;
}

@media (max-width: 600px) {
    .container {
        padding: 25px 20px;
    }

    .main-title {
        font-size: 24px;
    }

    .buttons {
        grid-template-columns: 1fr;
    }

    .btn {
        padding: 14px;
    }

    #music-player {
        width: 90%;
        padding: 10px 20px;
    }
}

@media (orientation: landscape) {
    .container {
        margin-top: 40px;
    }

    .buttons {
        grid-template-columns: repeat(4, 1fr);
    }

    #music-player {
        bottom: 30px;
        padding: 12px 22px;
    }

    #music-title {
        font-size: 14px;
    }

    #music-artist {
        font-size: 12px;
    }

    .music-control {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }

    .music-list-container {
        bottom: 80px;
        width: 320px;
    }

    .main-title-image {
        width: 80px;
        height: 80px;
    }
}
